// 基于template/src/widgets/\{{appEntities}}/\{{ctrls@TREEVIEW}}-tree/\{{spinalCase ctrl.codeName}}-tree-vo.ts.hbs生成
import { ControlVOBase } from '@/core';

{{#each ctrl.psDETreeNodes as | node |}}
    {{#if (and (eq node.treeNodeType 'DE') node.psAppDataEntity)}}
class {{pascalCase node.id}}ControlVO extends ControlVOBase {

    constructor(data: any){
        super(data);
        //  树自持属性
        this.$ownKeys = ['{{lowerCase node.psAppDataEntity.codeName}}', {{#each node.psAppDataEntity.allPSAppDEFields as | field |}}'{{lowerCase field.codeName}}'{{#unless @last}}, {{/unless}}{{/each}}];
    }
    {{#if node.leafFlagPSAppDEField}}
    get leafflag() {
        return this.$DO.{{lowerCase node.leafFlagPSAppDEField.codeName}};
    }
    set leafflag(value: any) {
        this.$DO.{{lowerCase node.leafFlagPSAppDEField.codeName}} = value;
    }
    {{/if}}
    {{#if node.idPSAppDEField}}
    get id() {
        return this.$DO.{{lowerCase node.idPSAppDEField.codeName}};
    }
    set id(value: any) {
        this.$DO.{{lowerCase node.idPSAppDEField.codeName}} = value;
    }
    {{/if}}
    {{#if node.iconPSAppDEField}}
    get icon() {
        return this.$DO.{{lowerCase node.iconPSAppDEField.codeName}};
    }
    set icon(value: any) {
        this.$DO.{{lowerCase node.iconPSAppDEField.codeName}} = value;
    }
    {{/if}}
    {{#if node.textPSAppDEField}}
    get text() {
        return this.$DO.{{lowerCase node.textPSAppDEField.codeName}};
    }
    set text(value: any) {
        this.$DO.{{lowerCase node.textPSAppDEField.codeName}} = value;
    }
    {{/if}}
    {{#if node.childCntPSAppDEField}}
    get counterid() {
        return this.$DO.{{lowerCase node.childCntPSAppDEField.codeName}};
    }
    set counterid(value: any) {
        this.$DO.{{lowerCase node.childCntPSAppDEField.codeName}} = value;
    }
    {{/if}}
    set {{lowerCase node.psAppDataEntity.keyPSAppDEField.codeName}}(value: any) {
        this.$DO.{{lowerCase node.psAppDataEntity.keyPSAppDEField.codeName}} = value;
    }
    get {{lowerCase node.psAppDataEntity.keyPSAppDEField.codeName}}() {
        return this.$DO.{{lowerCase node.psAppDataEntity.keyPSAppDEField.codeName}};
    }
    set srfkey(value: any) {
        this.$DO.{{lowerCase node.psAppDataEntity.keyPSAppDEField.codeName}} = value;
    }
    get srfkey() {
        return this.$DO.{{lowerCase node.psAppDataEntity.keyPSAppDEField.codeName}};
    }
    set {{lowerCase node.psAppDataEntity.majorPSAppDEField.codeName}}(value: any) {
        this.$DO.{{lowerCase node.psAppDataEntity.majorPSAppDEField.codeName}} = value;
    }
    get {{lowerCase node.psAppDataEntity.majorPSAppDEField.codeName}}() {
        return this.$DO.{{lowerCase node.psAppDataEntity.majorPSAppDEField.codeName}};
    }
}
    {{/if}}
{{/each}}

export const {{pascalCase ctrl.name}}ControlVO = [{{#each ctrl.psDETreeNodes as | node |}}{{#if (and (eq node.treeNodeType 'DE') node.psAppDataEntity)}}{{pascalCase node.id}}ControlVO{{#unless @last}}, {{/unless}}{{/if}}{{/each}}]